home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / perl5 / Tie::Handle.z / Tie::Handle
Encoding:
Text File  |  2002-10-03  |  3.3 KB  |  133 lines

  1.  
  2.  
  3.  
  4. TTTTiiiieeee::::::::HHHHaaaannnnddddlllleeee((((3333))))                                                  TTTTiiiieeee::::::::HHHHaaaannnnddddlllleeee((((3333))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      Tie::Handle - base class definitions for tied handles
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.          package NewHandle;
  13.          require Tie::Handle;
  14.  
  15.          @ISA = (Tie::Handle);
  16.  
  17.          sub READ { ... }            # Provide a needed method
  18.          sub TIEHANDLE { ... }       # Overrides inherited method
  19.  
  20.  
  21.          package main;
  22.  
  23.          tie *FH, 'NewHandle';
  24.  
  25.  
  26. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  27.      This module provides some skeletal methods for handle-tying classes. See
  28.      the _p_e_r_l_t_i_e manpage for a list of the functions required in tying a
  29.      handle to a package.  The basic TTTTiiiieeee::::::::HHHHaaaannnnddddlllleeee package provides a new
  30.      method, as well as methods TIESCALAR, FETCH and STORE. The new method is
  31.      provided as a means of grandfathering, for classes that forget to provide
  32.      their own TIESCALAR method.
  33.  
  34.      For developers wishing to write their own tied-handle classes, the
  35.      methods are summarized below. The the _p_e_r_l_t_i_e manpage section not only
  36.      documents these, but has sample code as well:
  37.  
  38.      TIEHANDLE classname, LIST
  39.           The method invoked by the command tie *glob, classname. Associates a
  40.           new glob instance with the specified class. LIST would represent
  41.           additional arguments (along the lines of the _A_n_y_D_B_M__F_i_l_e manpage and
  42.           compatriots) needed to complete the association.
  43.  
  44.      WRITE this, scalar, length, offset
  45.           Write _l_e_n_g_t_h bytes of data from _s_c_a_l_a_r starting at _o_f_f_s_e_t.
  46.  
  47.      PRINT this, LIST
  48.           Print the values in _L_I_S_T
  49.  
  50.      PRINTF this, format, LIST
  51.           Print the values in _L_I_S_T using _f_o_r_m_a_t
  52.  
  53.      READ this, scalar, length, offset
  54.           Read _l_e_n_g_t_h bytes of data into _s_c_a_l_a_r starting at _o_f_f_s_e_t.
  55.  
  56.      READLINE this
  57.           Read a single line
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. TTTTiiiieeee::::::::HHHHaaaannnnddddlllleeee((((3333))))                                                  TTTTiiiieeee::::::::HHHHaaaannnnddddlllleeee((((3333))))
  71.  
  72.  
  73.  
  74.      GETC this
  75.           Get a single character
  76.  
  77.      DESTROY this
  78.           Free the storage associated with the tied handle referenced by _t_h_i_s.
  79.           This is rarely needed, as Perl manages its memory quite well. But
  80.           the option exists, should a class wish to perform specific actions
  81.           upon the destruction of an instance.
  82.  
  83. MMMMOOOORRRREEEE IIIINNNNFFFFOOOORRRRMMMMAAAATTTTIIIIOOOONNNN
  84.      The the _p_e_r_l_t_i_e manpage section contains an example of tying handles.
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.